import request from '@/utils/request';
// import { TableListParams, TableListItem } from './data.d';

interface AnswerListParams {
  pid: number;
  type: number;
  beginSubTime: string;
  endSubTime: string;
  beginAuditTime: string;
  endAuditTime: string;
  pageIndex: number;
  pageSize: number;
}

interface DetailParams {
  tid: number;
  typeId: number;
  replyId: number;
  web: number;
}

export async function getAnswerList(params: AnswerListParams) {
  return request('/service/partTimerWb/topic/getPartTimeReplyList', {
    params,
  });
}

export async function getAnswerDetail(params: DetailParams) {
  return request('/service/partTimerWb/topic/gettopicdetail', {
    params,
  });
}

export async function submitReply(params) {
  return request('/service/partTimerWb/topic/modifyUnapprovedReply', {
    method: 'POST',
    data: params,
  });
}

export async function cancelReply(params) {
  return request('/service/partTimerWb/topic/abandonModify', {
    method: 'POST',
    data: params,
  });
}
